home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
APP
/
E-L
/
FindIt1.1.1.sea
/
FindIt Folder
/
ReadThisTextFile
< prev
next >
Wrap
Text File
|
1993-02-22
|
8KB
|
168 lines
FindIt
Introduction
One of the things that drives me nuts is trying to find out what header file
Apple put a function prototype into. Some are obvious some are not. So I wrote
a program to search through a folder, (or some folders, (or some folders inside
other folders)), full of text files for a text string.
If you find this program useful send me a post card or an E-mail message. If
you think this is a stupid program send me a postcard or an E-mail message and
tell me why.
Other free programs
ChemTools: Calculates molecular weight given a molecular formula, displays
some useful constants, displays valence electrons for atoms. Runs under
System 6 and System 7.
Table: A periodic table click on an element and get some useful information
about it. Runs under System 6 and System 7.
ChangeMaker: Drop a file or a set of files on Change maker and you can change
each file’s type and creator individually. Runs under System 7. But works with
System 6.
Instructions
Just drag a folder onto the FindIt icon. It is OK if there are other types of
files in the folder FindIt will skip those.
A small dialog box will appear. Enter the text you want to find. The text must
be exact. Regular expressions are not implemented. (Yet.) Using the check boxes
select either a case insensitive search, and/or recursive folder search. (A
recursive folder search, searches folders inside folders, inside folders…) Hit
the return key or click on the OK button. Also select whether or not you would
like the full path name of the file or just the file name displayed. FindIt
remembers the check box selections during a session and between runs.
If FindIt finds the text the full path name of the file will be displayed,
along with the line number the text was found on and the line as well.
FindIt uses the spinning beach ball cursor trick to let you know how things are
progressing. A little spin for each file.
“done.” is printed when FindIt is done searching all the files.
Text can be cut, copied or cleared from the display. Cmd-A doesn’t select all
the text, it clears it. Be careful.
To search again just drop a folder on the FindIt icon. It may be grayed out
because the application is running. There is no need to quit. The new results
are placed after the old results.
For ResEdit Users
There isn't much you can change using ResEdit, but you can change the “Found
in:” heading for the path to the file. It's in STR# resource 128 string 1.
Limitations
The display uses TextEdit to display the found files and lines. FindIt won’t
bomb if you try to stuff more than 32K character into the display but the
output is truncated. I tested this by finding “;” in the apple header files.
The search uses a straight Boyer-Moore text search. I wanted a fast search.
Maybe I’ll put in regular expression searching, if there is a real interest.
FindIt searches the files a line at a time. Lines should be less than 2048
characters long.
FindIt loads the whole file into a buffer to search it. If FindIt can’t get
a buffer large enough you will get a dialog saying “Not enough memory for x”
where x is some file. Try increasing FindIt’s memory partition.
There is some overhead for each file in the list of files to search. This
limits the size of the file that can be searched. The more files you search
the smaller the file you can search. If you have a problem with this, increase
the size the partition FindIt runs in.
If you try to search very deeply nested folders with the recursive folder
search the stack will overflow. By deep I mean an entire CDROM. I can search
the 67 Megs of data on my hard disk in a 256K byte partition with no problems
other than having to skip files too large to fit in memory.
Tips
I use System 7.0, and I keep an alias to the “Apple includes” next to an alias
of FindIt on the desktop. Any time I need to find out what file to include for
a function prototype, I just drop the Apple includes alias on the FindIt alias.
Since the line is printed out, this is also a good way to find the order of
variables in a function prototype.
Legal Stuff
Although FindIt is free, it is not “public domain”. It is copyrighted, and
the copyright will be enforced whenever appropriate.
The source is not, and will never be, available.
FindIt cannot be sold, either by itself or in combination with any other
product, without my express written permission. The one exception to this rule
is made for user groups. If you’re a user group which is publishing a CD-ROM or
floppy collection, you may include FindIt and all of its included files without
restriction, save that the original package is included. Contact me for
up-to-date versions and information.
FindIt may be posted on an information service which charges its users for
general connection time and downloading, but it may NOT be posted to an
information service which will charge for the specific right to download
FindIt, without my express written permission.
FindIt may be given away as a support utility for a package which is itself
to be given away. People who have need to distribute FindIt as a support
utility should contact me for up-to-date versions and information.
The following warranty is merely to cover the bases:
Geoffrey Clements makes no warranty, express or implied, with respect to the
software or documentation including (but not limited to) implied warranties of
merchantability and fitness for a particular purpose. In no event will
Geoffrey Clements be liable for loss of profits or goodwill or other indirect,
special, incidental, or consequential damages resulting from any defect in the
software or documentation, even if advised of the possibility of such damages.
Geoffrey Clements shall have no liability for any data stored with this
program, including the costs of recovering such data.
Some states do not allow the exclusion or limitation of implied warranties or
liability for incidental or consequential damages, so the above limitation or
exclusion may not apply to you. This warranty gives you specific legal rights,
and you may also have other rights which vary from state to state.
FindIt is copyright ©1993 by Geoffrey P. Clements. All rights reserved.
History
1.0.0 First Release.
1.0.1 If you allocate memory, you should check to make sure you get it. Duh!
Fixed some screen handling stuff. Fixed a memory leak.
1.0.2 2/2/93 Added a case insensitive search. Fixed a bug in which FindIt
would skip the last file in a folder. Fixed a bug where
GetNewCWindow is called even if the machine doesn't have
color Quickdraw. Remembering where the window was works
better.
1.1.0 2/11/93 Added “Recursive Folder Search” option. (Search folders inside
folders.) Always add text at the end of the display. Display
“Findit 1.1.0” as the display window title not “Search”
Fix the line numbering. Was off by one. Added “Display Full
Path Name” option. Increased partition size to 256K. Remember
what options where selected for last search. Don't bomb on older
machines that don't have Color Quickdraw, or at least pseudo
Color Quickdraw like the Classic II has.
1.1.1 2//93 This should repair a problem with some older Macs in which the
machine would bomb because of a Color Quickdraw call on non-
color Macs. Corrected a user interface guideline inconsistency.
Made Cmd-B clear all, and Cmd-A select all.
Geoffrey Clements
Internet: clementsg@gw1.hanscom.af.mil
US postal: 19 Samuel Rd.
Chelmsford, MA 01824